﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Web;

namespace LynxWiki
{
    public static class ClientUtility
    {
        public static HttpClient GetMembershipClient()
        {
            HttpClientHandler clHandler = new HttpClientHandler();
            clHandler.UseDefaultCredentials = true;
            HttpClient client = new HttpClient(clHandler);

            client.BaseAddress = new Uri(LynxWiki.DomainModel.WikiRoot.SiteUrl);

            client.DefaultRequestHeaders.Accept.Add(
                new MediaTypeWithQualityHeaderValue("application/xml"));

            return client;
        }

        public static HttpClient GetIFilterClient()
        {
            HttpClientHandler clHandler = new HttpClientHandler();
            clHandler.UseDefaultCredentials = true;
            HttpClient client = new HttpClient(clHandler);

            client.BaseAddress = new Uri(LynxWiki.DomainModel.WikiRoot.IFilterUrl);

            client.DefaultRequestHeaders.Accept.Add(
                new MediaTypeWithQualityHeaderValue("application/xml"));

            return client;
        }

    }
}